Add TO Go cdns/health and cdns/{name}/health#2305
Conversation
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
8b9adb6 to
7ec9108
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
There was a problem hiding this comment.
Do we think this should be a config? I have seen several times now where the type "RASCAL" was hard-coded and we had to change our TM type. IMO you should be able to make the type whatever you want and it should work.
There was a problem hiding this comment.
I think it should definitely be a config, once we've moved everything to Go. But right now, it's still hard-coded all over Perl.
I don't think we should make a config yet, which would make people think they could change it, when it'd still break to be anything but "RASCAL".
But definitely +100 when it's all Go, and we can set one variable. I've wanted to change our db "RASCAL" type to something like "monitor" for ages.
|
I would expect a heathtest.go to be a part of this PR is there a reason it is not included? |
|
Not sure what you mean. What would be in healthtest.go? |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
3f7eae2 to
9308805
Compare
|
Refer to this link for build results (access rights to CI server needed): |
mhoppa
left a comment
There was a problem hiding this comment.
One minor comment - also should we be adding tests?
There was a problem hiding this comment.
Given this looks like duplicate logic from https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/cdn/capacity.go as well as https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/cachesstats/cachesstats.go#L202 should you go ahead and replace the other functions with this utility function?
There was a problem hiding this comment.
Yes, they were copy-pasted, because the PRs were open at the same time, with the intention of combining them after one was merged to master. Good catch. I'll do that now.
There was a problem hiding this comment.
Done. Also with GetCRConfig.
This endpoint calls out to Traffic Monitor. The "API Test" framework doesn't currently support Monitors. It's also not really possible to unit test; we could mock everything, but it wouldn't be testing much of anything at that point (which is why we've been doing "API Tests" for TO). We should definitely test this (and other Monitor endpoints) when the API Tests support it. But it'll be a nontrivial amount of work to add that support. I just made #3924 - we had one for Riak, but not Monitors. |
|
Yes it will have the same problem |
|
I'd like to look into #3927 first. Not sure when I'll have time. It shouldn't be necessary, HTTP/2 is backwards-compatible by design. If a client tries to use H2, and a server doesn't support it, it automatically falls back to H1. If it doesn't, the Server is violating HTTP/1.1. So, it shouldn't ever be necessary to forcibly disable it. I'd like to at least understand why it's necessary. |
9308805 to
1b2474e
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Ok, I investigated, determined Go 1.13 http.Transport fundamentally doesn't support H2 Proxies. I added the code from #3927 and a comment to that effect. See golang/go#26479 "We only support http1 proxies currently." Rebased; manually tested again, still works as expected, still matches Perl. |
1b2474e to
e91e64f
Compare
e91e64f to
3e8cdb6
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
mhoppa
left a comment
There was a problem hiding this comment.
code looks good and tests locally good
mitchell852
left a comment
There was a problem hiding this comment.
appears to work as the Perl did.
Rewrites
/cdns/healthand/cdns/{{name}}/healthto Go. Closes #3778 and closes #3779 .